import { connect } from 'react-redux'
import ShopBus from '../../../views/Shop/ShopBus'

function mapStateToProps(state: any) {
    return {
        shopBusInfo: state.detail.shopBusInfo,
        shopBusRX: state.detail.shopBusRX,
        shopBusAll: state.detail.shopBusAll,
        shopBusNew: state.detail.shopBusNew,
        shopBusPromotion: state.detail.shopBusPromotion,
        shopBusCategory: state.detail.shopBusCategory,
        userInfo: state.user.userInfo,
    }
}

function mapDispatchToProps(dispatch: (obj: any) => void) {
    return {
        'SET_SHOP_BUS': (data: any) => {
            dispatch({ type: 'SET_SHOP_BUS', data })
        },
        'SET_SHOP_BUS_RX': (data: any) => {
            dispatch({ type: 'SET_SHOP_BUS_RX', data })
        },
        'SET_SHOP_BUSALL': (data: any) => {
            dispatch({ type: 'SET_SHOP_BUSALL', data })
        },
        'SET_SHOP_BUSPROMOTION': (data: any) => {
            dispatch({ type: 'SET_SHOP_BUSPROMOTION', data })
        },
        'SET_SHOP_BUSNEW': (data: any) => {
            dispatch({ type: 'SET_SHOP_BUSNEW', data })
        },
        'SET_SHOP_BUSCATEGORY': (data: any) => {
            dispatch({ type: 'SET_SHOP_BUSCATEGORY', data })
        },
    }
}

export default connect(mapStateToProps, mapDispatchToProps)(ShopBus)